package com.springboot.test.controller;

import com.springboot.test.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/11/22 16:44
 */
@Controller
public class HelloController {

    @Autowired
    private Person person;

    @Value("${person.last-name}")
    private String name;

    @ResponseBody
    @RequestMapping("/hello")
    public String hello() {
        return "hello world " + name + "\n" + person.toString();
    }

}
